28
A-Kind-Of relationship
Circle class
TASK: Consider you have to write a drawing program. This program would allow drawing of various objects such as points, circles, rectangles, triangles and many more. For each object you provide a class definition.
class Circle {
attributes:
int x, y, radius
methods:
setX(int newX)
getX()
setY(int newY)
getY()
setRadius(newRadius)
getRadius()
}
(x, y, radius)
X
Y
radius